package com.qianfeng.dao;

import com.qianfeng.model.Consume;
import com.qianfeng.util.DBUtil;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.ColumnListHandler;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class ConsumeDao {
    public List<Consume> Search() throws SQLException {
        QueryRunner runner=new QueryRunner(DBUtil.getDataSource());
        String sql="select * from consume_list ";
        List<Consume> list=runner.query(sql,new BeanListHandler<>(Consume.class));
        return  list;
    }
    public  boolean updateMoney(int id,double price) throws SQLException {
        QueryRunner runner=new QueryRunner(DBUtil.getDataSource());
        String sql="";
        return true;
    }
}
